<template>

	<pagesIndex v-show="tabPage=='home'" :title="title"></pagesIndex>
	<pagesMall v-if="tabPage=='mall'" title="一键预订"></pagesMall>

	<pagesOrder v-if="tabPage=='order'" :reachBottom="reachBottom" title="我的订单"></pagesOrder>

	<PagesUser v-show="tabPage=='user'"></PagesUser>

	<kb-tabs-bar :current="tabPage"></kb-tabs-bar>



</template>

<script>
	import PagesIndex from "@/pages/index/index.vue";
	import PagesMall from "@/pages/index/mall.vue";
	import PagesOrder from "@/pages/index/order.vue";
	import PagesUser from "@/pages/index/user.vue";
	
	export default {
		components: {
			PagesIndex,
			PagesMall,
			PagesOrder,
			PagesUser
		},

		data() {
			return {
				title: "", 
				reachBottom: 0,
			}
		},

		computed: {
			tabPage: function() {
				return this.ee.pageBarName;
			} 
		},

		methods: {

		},
		onLoad() {
			this.title = this.ee.account.name;
		},
		onPageScroll() {

		},
		onPullDownRefresh() {
			//下拉刷新页面时重新获取基础数据
			//发送全局事件，在app.vue里面onLaunch方法监听
			uni.$emit('refreshInitData');
			//发送全局事件，在app.vue里面onLaunch方法监听
			uni.stopPullDownRefresh();
		},
		onReachBottom() {
			//滚动页面 发消息给子组件
			this.reachBottom++;
			// console.log('onReachBottom',this.reachBottom)
		}
	}
</script>

<style>
</style>